The token single-ring ordering and membership protocol provides a mechanism to submit a message to an upper-layer service in a global and orderly manner within a broadcast domain, so as to ensure the reliability and orderliness of message transferring. On a network that supports the token single-ring ordering and membership protocol, such as a token ring network, a token controls each node to access the token ring network. The token is passed between nodes on the token ring network in an orderly manner. Only a node that has the token is capable of broadcasting a message on the token ring network. Each node receives all messages sent by other nodes within a token passing period and stores the received messages in a receive buffer queue. If the number of messages broadcast by a node is not limited, a node with a relatively slow processing speed on the token ring network may fail to process messages in the receive buffer queue in time, resulting in an overflow of the receive buffer queue. To prevent occurrence of this situation, traffic on the network needs to be controlled.
A method for controlling traffic in the prior art is as follows:
In a token passing period: the total number of messages that all nodes can transmit is specified as N; the maximum number of messages that each node can transmit after it gets a token is specified as M; for a node that transmits more messages, it can be considered to allocate a larger transmission proportion to the node, and the number of messages that the node can transmit by proportion is further specified as K=[(cbl/backlog)×N], where cbl indicates the number of messages to be transmitted by the node that gets the token, backlog indicates the total number of messages to be transmitted by all nodes, and [ ] indicates rounding down to the nearest integer. After the passing order of the token changes, the token passing period ends.
Accordingly, the number of messages that each node can transmit finally is X=min (M, K, N-fcc), where fcc indicates the total number of messages that have been transmitted by all nodes that have transmitted messages in the current token passing period.
During the implementation of the present invention, the inventor finds that the prior art has at least the following problems.
When a network is severely congested, a large number of messages may be lost. According to requirements of the token single-ring ordering protocol on message reliability, a node requests retransmission of a lost message. The method for controlling network traffic in the prior art does not consider the situation of network congestion, which results in more and more retransmitted messages, thereby increasing network load. In addition, increasing of retransmitted messages results in an overflow of a retransmission list in a token, and loss of massive messages results in that the messages in the receive buffer queue cannot be submitted in an orderly manner, further resulting in an overflow of the receive buffer queue and lowering cluster availability.